import { request } from "@/utils/service"
import type * as Type from "./types/courseType"

/** 增 */
export function createTypeDataApi(data: Type.CreateOrUpdateTypeRequestData) {
  return request({
    url: "type",
    method: "post",
    data
  })
}

/** 删 */
export function deleteTypeDataApi(ids: string) {
  return request({
    url: `type/batch?ids=${ids}`,
    method: "delete"
  })
}

// /** 改 */
export function updateTypeDataApi(data: Type.CreateOrUpdateTypeRequestData) {
  return request({
    url: "type",
    method: "put",
    data
  })
}

/** 查 */
export function getTypeDataApi(params: Type.GetTypeRequestData) {
  return request<Type.GetTypeResponseData>({
    url: "type",
    method: "get",
    params
  })
}
